package com.itheima.health.controller;

import com.itheima.health.dto.ReportDto;
import com.itheima.health.entity.Result;
import com.itheima.health.service.ReportService;
import com.itheima.health.vo.ReportVo;
import io.swagger.annotations.Api;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("report")
@Api(tags = "套餐管理开发")  // 作用在类上
public class ReportController {
    @Reference
    private ReportService reportService;

    /**
     * 会员占比
     * @return
     */
    @GetMapping("setmealProportion")
    public Result setmealProportion(){
        return new Result(reportService.setmealProportion());
    }

    /**
     * 会员数量统计
     * @return
     */
    @PostMapping("memberReportByLastYear")
    public Result memberReportByLastYear(@RequestBody ReportDto reportDto ){
        ReportVo reportResult = reportService.memberReportByLastYear(reportDto);
        return   new Result(reportResult);
    }

}
